/* ====================================================================
 * (#)Header: EntityService.java
 * (#)Revision: 
 * (#)Date Created: 22-Mar-08 12:47:15 AM
 * (#)Created By: Karol Wozniak
 * ====================================================================
 *
 * Copyright (c) 2007 karolak .  All rights reserved.
 *
 * ====================================================================
 * 
 * The software application represented here is the sole property of 
 * karolak. Its unauthorized utilization is expressly prohibited.
 * 
 * ====================================================================
 */
package com.karolak.service.entity;

import java.util.List;

import com.karolak.query.Criterias;

/**
 * <code>EntityService</code> is used to ....
 * 
 * @author <a href="mailto:kwozniak@hotmail.com">Karol Wozniak</a>
 */
public interface EntityService<T, Id> {

	// === dao delegates === //
	// === finders === //
	public T findById(Id id);
	public T find(Criterias criterias);

	// === crud === //
	public T create(T entity);
	public T update(T entity);
	public void remove(Id id);

	// === selectors === //
	public List<T> select();
	public List<T> select(Criterias criterias);

	// === range selectors === //
	public List<T> select(int startPosition, int maxResult);
	public List<T> select(Criterias criterias, int startPosition, int maxResult);

	// === count selectors === //
	public int selectCount();
	public int selectCount(Criterias criterias);
}
